import { defineStore } from 'pinia'

export const useUIStore = defineStore('ui', {
  state: () => ({
    activeMemoryType: 'doll', // 默认选中娃娃类型
    expandedDolls: false, // 娃娃列表是否展开
  }),

  actions: {
    setActiveMemoryType(type: string) {
      this.activeMemoryType = type
    },

    setExpandedDolls(expanded: boolean) {
      this.expandedDolls = expanded
    },
  },

  persist: {
    enabled: true,
    strategies: [
      {
        key: 'memory-ui',
        storage: localStorage,
      },
    ],
  },
})
